import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/equip_instrument_entity.dart';

EquipInstrumentEntity $EquipInstrumentEntityFromJson(Map<String, dynamic> json) {
  final EquipInstrumentEntity equipInstrumentEntity = EquipInstrumentEntity();
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    equipInstrumentEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    equipInstrumentEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    equipInstrumentEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    equipInstrumentEntity.deleted = deleted;
  }
  final String? deviceId = jsonConvert.convert<String>(json['deviceId']);
  if (deviceId != null) {
    equipInstrumentEntity.deviceId = deviceId;
  }
  final String? deviceName = jsonConvert.convert<String>(json['deviceName']);
  if (deviceName != null) {
    equipInstrumentEntity.deviceName = deviceName;
  }
  final String? faultHandling = jsonConvert.convert<String>(json['faultHandling']);
  if (faultHandling != null) {
    equipInstrumentEntity.faultHandling = faultHandling;
  }
  final String? interlockLog = jsonConvert.convert<String>(json['interlockLog']);
  if (interlockLog != null) {
    equipInstrumentEntity.interlockLog = interlockLog;
  }
  final String? filePath = jsonConvert.convert<String>(json['filePath']);
  if (filePath != null) {
    equipInstrumentEntity.filePath = filePath;
  }
  final List<String>? filePathList = (json['filePathList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (filePathList != null) {
    equipInstrumentEntity.filePathList = filePathList;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    equipInstrumentEntity.id = id;
  }
  final String? instrumentLogo = jsonConvert.convert<String>(json['instrumentLogo']);
  if (instrumentLogo != null) {
    equipInstrumentEntity.instrumentLogo = instrumentLogo;
  }
  final String? interlockDeviceType = jsonConvert.convert<String>(json['interlockDeviceType']);
  if (interlockDeviceType != null) {
    equipInstrumentEntity.interlockDeviceType = interlockDeviceType;
  }
  final String? interlockDeviceTypeName = jsonConvert.convert<String>(json['interlockDeviceTypeName']);
  if (interlockDeviceTypeName != null) {
    equipInstrumentEntity.interlockDeviceTypeName = interlockDeviceTypeName;
  }
  final String? interlockLogic = jsonConvert.convert<String>(json['interlockLogic']);
  if (interlockLogic != null) {
    equipInstrumentEntity.interlockLogic = interlockLogic;
  }
  final String? interlockOperation = jsonConvert.convert<String>(json['interlockOperation']);
  if (interlockOperation != null) {
    equipInstrumentEntity.interlockOperation = interlockOperation;
  }
  final String? interlockOrder = jsonConvert.convert<String>(json['interlockOrder']);
  if (interlockOrder != null) {
    equipInstrumentEntity.interlockOrder = interlockOrder;
  }
  final String? interlockRelation = jsonConvert.convert<String>(json['interlockRelation']);
  if (interlockRelation != null) {
    equipInstrumentEntity.interlockRelation = interlockRelation;
  }
  final String? isUsed = jsonConvert.convert<String>(json['isUsed']);
  if (isUsed != null) {
    equipInstrumentEntity.isUsed = isUsed;
  }
  final String? interlockStatus = jsonConvert.convert<String>(json['interlockStatus']);
  if (interlockStatus != null) {
    equipInstrumentEntity.interlockStatus = interlockStatus;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    equipInstrumentEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    equipInstrumentEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    equipInstrumentEntity.updateDate = updateDate;
  }
  return equipInstrumentEntity;
}

Map<String, dynamic> $EquipInstrumentEntityToJson(EquipInstrumentEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['deviceId'] = entity.deviceId;
  data['deviceName'] = entity.deviceName;
  data['faultHandling'] = entity.faultHandling;
  data['interlockLog'] = entity.interlockLog;
  data['filePath'] = entity.filePath;
  data['filePathList'] = entity.filePathList;
  data['id'] = entity.id;
  data['instrumentLogo'] = entity.instrumentLogo;
  data['interlockDeviceType'] = entity.interlockDeviceType;
  data['interlockDeviceTypeName'] = entity.interlockDeviceTypeName;
  data['interlockLogic'] = entity.interlockLogic;
  data['interlockOperation'] = entity.interlockOperation;
  data['interlockOrder'] = entity.interlockOrder;
  data['interlockRelation'] = entity.interlockRelation;
  data['isUsed'] = entity.isUsed;
  data['interlockStatus'] = entity.interlockStatus;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EquipInstrumentEntityExtension on EquipInstrumentEntity {
  EquipInstrumentEntity copyWith({
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? deviceId,
    String? deviceName,
    String? faultHandling,
    String? interlockLog,
    String? filePath,
    List<String>? filePathList,
    String? id,
    String? instrumentLogo,
    String? interlockDeviceType,
    String? interlockDeviceTypeName,
    String? interlockLogic,
    String? interlockOperation,
    String? interlockOrder,
    String? interlockRelation,
    String? isUsed,
    String? interlockStatus,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return EquipInstrumentEntity()
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..deviceId = deviceId ?? this.deviceId
      ..deviceName = deviceName ?? this.deviceName
      ..faultHandling = faultHandling ?? this.faultHandling
      ..interlockLog = interlockLog ?? this.interlockLog
      ..filePath = filePath ?? this.filePath
      ..filePathList = filePathList ?? this.filePathList
      ..id = id ?? this.id
      ..instrumentLogo = instrumentLogo ?? this.instrumentLogo
      ..interlockDeviceType = interlockDeviceType ?? this.interlockDeviceType
      ..interlockDeviceTypeName = interlockDeviceTypeName ?? this.interlockDeviceTypeName
      ..interlockLogic = interlockLogic ?? this.interlockLogic
      ..interlockOperation = interlockOperation ?? this.interlockOperation
      ..interlockOrder = interlockOrder ?? this.interlockOrder
      ..interlockRelation = interlockRelation ?? this.interlockRelation
      ..isUsed = isUsed ?? this.isUsed
      ..interlockStatus = interlockStatus ?? this.interlockStatus
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
